<div class="wrap_marquee">
    <div id="marquee_p">
        {{if isset($slide)}}
        
        {{$k = 1}}
        {{for $i=0 to $slide['num']-1}}
        <div>
            {{for $j=$i*2 to $k}}
            {{if $j==$i*2}}{{$class='wrap1'}}{{else}}{{$class='wrap2'}}{{/if}}
            <div class="{{$class}}">
                {{if isset($slide['best-selling'][$j])}}{{$item = $slide['best-selling'][$j]}}
                {{if isset($category)}}{{$main_cat_code=$category->get_parent_category($item->category_id)}}{{/if}}
                {{$url='san-pham/'|cat:$main_cat_code->code|cat:'/'|cat:$category->get_title_category_id($item->category_id)->code|cat:'/'|cat:$item->code}}
                <a href="{{$url|base_url}}">
                    <div>
                        <h1>{{$item->title}}</h1>
                        <p>{{$item->description|escape:'html'|truncate:120:'...'}}</p>
                        <p class="pri">{{if $item->old_price != $item->new_price}}{{$item->old_price|vnd_format:''}} VNĐ <br /> <span>{{/if}}{{$item->new_price|vnd_format:''}} VNĐ</span></p>
                    </div>
                    <img src="{{$item->best_selling_image|base_url}}" alt="" />
                </a>
                <div class="wrap_btn bottom">
                    <a href="javascript:;" onclick="addItemToCart({{$item->id}});" class="btn_add"></a>
                    <a class="btn_info"></a>
                </div>
                {{if $item->old_price!=$item->new_price}}
                <div class="sale small">
                    <span>Giảm <abbr>{{saleprice old_price=$item->old_price new_price=$item->new_price}}%</abbr></span>
                </div>
                {{/if}}
                {{/if}}
            </div>
            {{/for}}
            {{$k = $k + 2}}
        </div>
        {{/for}}
        {{/if}}
    </div>
    <span class="prev"></span>
    <span class="next"></span>
</div>